/**
 * 
 */
package de.homeR.android;

import java.util.ArrayList;
import java.util.List;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

/**
 * @author André Stannek
 * 
 */
public class ManageAdapterActivity extends ListActivity {

	@Override
	public void onCreate(final Bundle icicle) {
		super.onCreate(icicle);
		ArrayAdapter<AdapterListItemModel> adapter = new AdapterListAdapter(
				this, getModel());
		setListAdapter(adapter);
	}

	private static List<AdapterListItemModel> getModel() {
		List<AdapterListItemModel> list = new ArrayList<AdapterListItemModel>();
		list.add(get("Linux"));
		list.add(get("Windows7"));
		list.add(get("Suse"));
		list.add(get("Eclipse"));
		list.add(get("Ubuntu"));
		list.add(get("Solaris"));
		list.add(get("Android"));
		list.add(get("iPhone"));
		// Initially select one of the items
		list.get(1).setSelected(true);
		return list;
	}

	private static AdapterListItemModel get(final String s) {
		return new AdapterListItemModel(s);
	}
}
